package com.ruoyi.iot.service.impl;

import com.ruoyi.iot.domain.entity.DeviceTemperatureWindow;
import com.ruoyi.iot.domain.query.DeviceTemperatureWindowQuery;
import com.ruoyi.iot.mapper.DeviceTemperatureWindowMapper;
import com.ruoyi.iot.service.DeviceTemperatureWindowService;
import java.util.List;
import org.springframework.stereotype.Service;

/**
 * 设备温度窗口服务实现
 */
@Service
public class DeviceTemperatureWindowServiceImpl implements DeviceTemperatureWindowService {

    private final DeviceTemperatureWindowMapper deviceTemperatureWindowMapper;

    public DeviceTemperatureWindowServiceImpl(DeviceTemperatureWindowMapper deviceTemperatureWindowMapper) {
        this.deviceTemperatureWindowMapper = deviceTemperatureWindowMapper;
    }

    /**
     * 查询设备温度窗口列表
     *
     * @param query 查询条件
     * @return 温度窗口列表
     */
    @Override
    public List<DeviceTemperatureWindow> list(DeviceTemperatureWindowQuery query) {
        DeviceTemperatureWindowQuery safeQuery = query == null ? new DeviceTemperatureWindowQuery() : query;
        return deviceTemperatureWindowMapper.selectList(safeQuery);
    }
}
